<template>
  <div>
    父组件
    <button @click="fn1">调用子组件的获取数据方法</button>
    <button @click="fn2">调用子组件的重置数据方法</button>
    <BaseForm ref="baseForm" />
  </div>
</template>

<script>
import BaseForm from './components/BaseForm.vue'
export default {
  components: {
    BaseForm
  },
  data() {
    return {

    }
  },
  methods: {
    fn1() {
      console.log(this.$refs.baseForm.username)
      this.$refs.baseForm.submit()
    },
    fn2() {
      this.$refs.baseForm.reset()
    }
  }
}
</script>

<style>
.base-chart-box {
  width: 400px;
  height: 300px;
  background-color: red;
  border-radius: 6px;
}
</style>
